package cn.core.tool.exception;

/**
 * 异常封装
 */
public class CoreException extends Exception {

  private static final long serialVersionUID = 1L;

  /**
   * 报错
   */
  public static final String E_ERR = "连接失败，请检查！";

  /**
   * 参数错误
   */
  public static final String E_PARAM_ERR = "参数错误，请检查！";

  /**
   * 数据已被修改
   */
  public static final String E_VERSIONS_ERR = "数据已被修改，请刷新重试！";

  /**
   * 分页参数错误
   */
  public static final String E_PAGING_PARAM_ERR = "分页参数错误，请检查！";

  /**
   * 数据重复
   */
  public static final String E_DATA_REPEAT_ERR = "数据重复，请检查！";

  /**
   * 数据为空
   */
  public static final String E_DATA_IS_NULL_ERR = "数据不能为空，请检查！";

  /**
   * 数据源加载错误
   */
  public static final String E_ADD_DATA_SOURCE_ERR = "数据源加载失败，请检查！";

  /**
   * 请求无法连接
   */
  public static final String E_REQUEST_CANNOT_CONNECT = "请求无法连接，请检查！";

  /**
   * 请求未授权
   */
  public static final String E_REQUEST_UNAUTHORIZED = "请求未授权，请检查！";

  /**
   * 请求错误
   */
  public static final String E_REQUEST_ERR = "请求错误，请检查！";

  /**
   * 请求响应解析失败
   */
  public static final String E_REQUEST_RESPONSE_PARSE_FAILED = "请求响应解析失败，请检查！";

  /**
   * 上传文件大小超过最大限制
   */
  public static final String E_UPLOAD_FILE_SIZE_EXCEEDS_THE_MAXIMUM_LIMIT = "上传文件大小超过最大限制，请检查！";

  protected String errMsg;

  public CoreException(String errMsg) {
    super(errMsg);
    this.errMsg = errMsg;
  }

  public String getErrMsg() {
    return errMsg;
  }

}
